package com.zzty.txj1.controller;


import com.zzty.txj1.entity.Question;
import com.zzty.txj1.entity.SelfExam;
import com.zzty.txj1.entity.TeamExam;
import com.zzty.txj1.service.QuestionService;
import com.zzty.txj1.service.SelfExamService;
import com.zzty.txj1.service.TeamExamService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/selfExam")
public class SelfExamController {

    @Autowired
    QuestionService questionService;

    @Autowired
    private SelfExamService selfExamService;

    @RequestMapping("/addQuestion")
    public Integer addQuestion(Question question){
        Integer count=questionService.addQuestion(question);
        return count;
    }

    @RequestMapping(value = "/checkByDateAndClazzId")
    public SelfExam checkByDateAndClazzId(SelfExam selfExam){
        SelfExam selfExam1=selfExamService.checkByDateAndClazzId(selfExam);
        System.out.println("selfExam1|"+selfExam1);
        return  selfExam1;
    }
    @RequestMapping(value = "/insertSelfExam",method = RequestMethod.POST)
    public Integer insertTeamExam(SelfExam selfExam){
        Integer count=selfExamService.insertTeamExam(selfExam);
        return count;
    }
}
